<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<title>글보기 : ${requestScope.contentMap.pvo.productionNo}번글</title>
<link rel="stylesheet" href="${initParam.root}/css/indiwood-ui.css"
	type="text/css">
<script type="text/javascript">
	$(document)
			.ready(
					function() {
						var type = "";
						$("#delImg")
								.click(
										function() {
											type = "delete";
											if (confirm(type + "하시겠습니까?") == false) {
												$("#inputPass").html("");
												return;
											} else {
												location.href = "${initParam.root}production/deleteBoard.do?no=${contentMap.pvo.productionNo }";
											}
										});
						$("#updateImg")
								.click(
										function() {
											type = "update";

											if (confirm(type + "하시겠습니까?") == false) {
												$("#inputPass").html("");
												return;
											} else {
												location.href = "${initParam.root}production/updateView.do?no=${contentMap.pvo.productionNo }";
											}
										});
						$(".action[name=comment_submit]").click(function() {
							if ($(":input[name=commentContent]").val() == "") {
								alert("내용을 입력하세요");
								return;
							}
							$("form[name=commentWrite_form]").submit();
						});
					});
</script>
<h3>우리들이 만든 영화 - 상세정보</h3>
<hr align="left" width="150">
<center>
	<table class="content">
		<tr>
			<td><b>${requestScope.contentMap.pvo.productionNo}-${requestScope.contentMap.pvo.title}</b>
			</td>
		</tr>
		<tr>
			<td><font size="2">글쓴이:
					${requestScope.contentMap.pvo.mvo.nick } | 조회수:
					${requestScope.contentMap.pvo.hit } |
					${requestScope.contentMap.pvo.date}</font></td>
		</tr>
			<tr>
			<td colspan="3">
				<iframe width="500" height="300" src="//www.youtube.com/embed/${requestScope.contentMap.pvo.videoPath}" frameborder="0" allowfullscreen></iframe>
			</td>
		</tr>
		<tr>
			<td><img src="${initParam.root}/upload/production/${requestScope.contentMap.pvo.imagePath}" width="100" height="100">
		</tr>
		<tr>
			<td align="center"><textarea cols="70" rows="10" name="content"
					readonly="readonly">${requestScope.contentMap.pvo.content }</textarea></td>
		</tr>

		<tr>
			<td align="center"><a href="list.do"><img
					src="${initParam.root}/img/list_btn.jpg"></a> <c:if
					test="${sessionScope.mvo.email == requestScope.contentMap.pvo.memberEmail}">
					<img class="action" id="updateImg"
						src="${initParam.root}/img/modify_btn.jpg">
					<img class="action" id="delImg"
						src="${initParam.root}/img/delete_btn.jpg">
				</c:if></td>
		</tr>
		<tr>
			<td align="left">덧글</td>
		</tr>
		<tr>
			<td>
				<table class="commentList">
					<tbody>
						<c:forEach var="pcvo"
							items="${requestScope.contentMap.commentList}">
							<tr>
								<td>${pcvo.productionCommentNo }</td>
								<td>${pcvo.productionVO.memberEmail}</td>
								<td>${pcvo.commentContent }</td>
								<td>${pcvo.date }</td>
<%-- 								<c:if test="${sessionScope.mvo.email == pcvo.memberEmail}">
									<td><img class="action" id="upCommentImg" src="${initParam.root}/img/modify_btn.jpg"></td>
									<td><img class="action" id="deCommentImg" src="${initParam.root}/img/delete_btn.jpg"></td>
								</c:if> --%>
							</tr>
							</c:forEach>
							</tbody>
							</table>
							</td>
							</tr>

				 <c:if test="${sessionScope.mvo!=null }">
					<form action="${initParam.root }production/commentWrite.do"
						name="commentWrite_form">
						<input type="hidden" name="memberEmail"
							value="${sessionScope.mvo.email }"> <input type="hidden"
							name="productionNo"
							value="${requestScope.contentMap.pvo.productionNo}">
						<table class="commentWrite">
							<tr>
								<td align="center"><textarea name="commentContent"
										cols="50" rows="2" maxlength="1000"
										style="resize: none; overflow: hidden; line-height: 11px; height: 59px;"></textarea>
									<img class="action" src="${initParam.root}/img/confirmBtn.gif"
									alt="확인" name="comment_submit"></td>
							</tr>
							</tbody>
						</table>
					</form>
				</c:if>
			</td>
		</tr>
	</table>
</center>